package com.marry.business.repository.user;

import com.marry.contract.vo.SysUser;
import feign.Param;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono;


/**
 * @path：com.marry.mapper.UserMapper.java
 * @className：UserMapper.java
 * @description：用户信息
 * @author：杨超
 * @dateTime：2020/10/28 16:46
 * @editNote：
 */
@Repository
public interface UserRepository extends R2dbcRepository<SysUser, String> {

    /**
     * 通过用户名查找user
     * @param userName
     * @return
     */
    @Query("SELECT id,birthday,salt,sex,update_time,avatar,password,create_time,phone,name,email,status,username " +
            "FROM sys_user " +
            "WHERE username = :userName")
    Mono<SysUser> findByUserName(@Param("userName") String userName);

}
